package Service;

import DAO.ShpTrolleyDao;
import Entities.DoeBookEntity;

import javax.transaction.Transactional;
import java.util.List;

@Transactional
public class ShpTrolleyService
{
    private ShpTrolleyDao shpTrolleyDao;

    public ShpTrolleyDao getShpTrolleyDao() {
        return shpTrolleyDao;
    }

    public void setShpTrolleyDao(ShpTrolleyDao shpTrolleyDao)
    {
        this.shpTrolleyDao = shpTrolleyDao;
    }

    //添加一条记录到购物车数据表中
    public String addRecord(String user_name, String bookId)
    {
        return shpTrolleyDao.addRecord(user_name, bookId);
    }

    //返回某个用户的购物车列表
    public List<DoeBookEntity> returnShpTrolleyList(String user_name)
    {
        return shpTrolleyDao.returnShpTrolleyList(user_name);
    }

}